import BpmnModeler from "bpmn-js/lib/Modeler";
import propertiesPanelModule from "bpmn-js-properties-panel";
import propertiesProviderModule from "bpmn-js-properties-panel/lib/provider/camunda";
import camundaModdleDescriptor from "camunda-bpmn-moddle/resources/camunda";
import customModule from "./custom";
// import { log10 } from "core-js/core/number";

export function initModeler(canvas) {
  return new BpmnModeler({
    container: canvas,
    propertiesPanel: {
      parent: "#js-properties-panel"
    },
    additionalModules: [
      // 右边的属性栏
      propertiesProviderModule,
      propertiesPanelModule,
      customModule //自定义module
    ],
    moddleExtensions: {
      camunda: camundaModdleDescriptor
    }
  });
}
